package com.gz.furnitures.service.impl;

import com.gz.furnitures.dao.impl.AdminDaoImpl;
import com.gz.furnitures.entity.Admin;
import com.gz.furnitures.service.AdminService;

public class AdminServiceImpl implements AdminService {
    AdminDaoImpl adminDao = new AdminDaoImpl();
    @Override
    public boolean isExistsAdminName(String username) {
        Admin admin = adminDao.queryAdminByName(username);
        return admin != null;
    }

    @Override
    public Admin login(Admin admin) {
        return adminDao.queryAdminByNameAndPassword(admin.getUsername(), admin.getPassword());
    }
}
